package com.medical.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.medical.mapper.HospitalpackageMapper;
import com.medical.mapper.HospitalpackageMapperCustom;
import com.medical.po.Hospitalpackage;
import com.medical.po.HospitalpackageCustom;
import com.medical.service.PackageService;

/** 
* @author  LTT-AH-ZY
* @date 创建时间：2017年8月21日 下午5:06:58 
* @version 1.0 
* @parameter 参数及其意义
* @since 最早使用该方法/类/接口的JDK版本 
* @since  
* @return  
*/

public class PackageServiceImpl implements PackageService{
	@Autowired
	private HospitalpackageMapperCustom hospitalpackageMapperCustom;
	@Autowired
	private HospitalpackageMapper hospitalpackageMapper;
	@Override
	public int InsertHospitalpackage(HospitalpackageCustom hospitalpackageCustom) throws Exception {
		// insert into hospitalpackage
		return hospitalpackageMapperCustom.InsertHospitalpackage(hospitalpackageCustom);
	}
	@Override
	public Hospitalpackage getHospitalpackageById(Integer packageid) throws Exception {
		// select * from hopsitalpackage by packageid
		return hospitalpackageMapper.selectByPrimaryKey(packageid);
	}
	@Override
	public int UpdateHospitalPackage(Integer packageid, Hospitalpackage hospitalpackage) throws Exception {
		// update table hospitalpackage by packageid
		hospitalpackage.setPackageid(packageid);
		return hospitalpackageMapper.updateByPrimaryKeySelective(hospitalpackage);
	}
	@Override
	public List<HospitalpackageCustom> getHospitalpackageList(HospitalpackageCustom hospitalpackageCustom)
			throws Exception {
		// select * from hospitalpackage by hospid 
		return hospitalpackageMapperCustom.getHospitalpackageList(hospitalpackageCustom);
	}
}
